package cn.springmvc.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.springmvc.dao.BaseDAO;
import cn.springmvc.model.entity.UserBean;

@Repository
public class UserDAOImpl implements BaseDAO<UserBean> {
	@Autowired(required=true)
	private SqlSession sqlSession;

	public boolean insert(UserBean t) {
		return sqlSession.insert("insertUser", t) > 0;
	}

	public List<UserBean> select(UserBean t) {
		return sqlSession.selectList("selectUser",t);
	}

	public boolean delete(UserBean t) {
		return sqlSession.delete("deleteUser", t) > 0;
	}

	public boolean update(UserBean t) {
		return sqlSession.update("updateUser", t) > 0;
	}

	public UserBean selectOne(UserBean t) {
		return sqlSession.selectOne("selectOneUser", t);
	}

}
